<table id="statistics_alarmlogs" title="" class="easyui-datagrid" style="width: 100%" url="/admin/statistics/alarmlogs"
       toolbar="#statistics-alarmlogs-datagrid-toolbar" pagination="true" pageSize="50" rownumbers="true" nowrap="false"
       checkOnSelect="false"
       singleSelect="true" pageList="[50,100,150,300]"
       tabPosition="bottom" fitColumns="true" fit="true" showFooter="true" striped="false" data-options="">
    <thead>
    <tr>
        <!--<th data-options="field:'ck',checkbox:true"></th>-->
        <th data-options="field:'codeserial',align:'center',width:150">设备编号</th>
        <th data-options="field:'device_category',align:'center',width:150">设备类型</th>
        <th data-options="field:'type',align:'center',width:150">警报类型</th>
        <th data-options="field:'device_address',align:'center',width:100">设备位置</th>
        <th data-options="field:'created_time',align:'center',width:100">报警时间</th>
        <th data-options="field:'alarms_times',align:'center',width:100">报警次数</th>
        <th data-options="field:'status',align:'center',width:100">处置状态</th>
        <th data-options="field:'user',align:'center',width:100">解除人</th>
        <th data-options="field:'manager_phone',align:'center',width:100">接收报警电话</th>
        <th data-options="field:'disposal_platform',align:'center',width:100">解除平台</th>
        <th data-options="field:'updated_time',align:'center',width:100">解除时间</th>
        <!--<th data-options="field:'id',align:'center',formatter:StatisticsAlarmsLogsModel.operate,width:100">管理员操作</th>-->
    </tr>
    </thead>
</table>
<style>
    label {
        margin-left: 5px;
    }
</style>
<div id="statistics-alarmlogs-datagrid-toolbar" style="padding:5px;height:auto">
    <form style="margin:10px">
        <label>报警时间:</label>
        <input id="log_alarm_start_date" class="easyui-datebox" style="width:100px">
        - <input id="log_alarm_end_date" class="easyui-datebox" style="width:100px">
        <label for="alarm_type">警报类型：</label>
        <select id="alarm_type" class="easyui-combobox" style="width: auto" panelMaxHeight="200px;"
                data-options="panelHeight:'auto'">
            <option value="0">全部</option>
            <volist name="type_config" id="name">
                <option value="<{$key}>"><{$name}></option>
            </volist>
        </select>
        <label for="disposal_platform">解除平台：</label>
        <select id="disposal_platform" class="easyui-combobox" style="width: auto;" panelMaxHeight="200px;"
                data-options="panelHeight:'auto'">
            <option value="0">全部</option>
            <volist name="disposal_platform_config" id="name">
                <option value="<{$key}>"><{$name}></option>
            </volist>
        </select>
        <br/>
        <br/>
        <label for="log_alarm_keyword">关键字：</label> <input type="text" class="easyui-textbox" id="log_alarm_keyword"
                                                           style="margin-right: 5px">
        <select name="" id="log_alarm_keyword_type" class="easyui-combobox" style="width: 150px;" panelMaxHeight="200px;"
                data-options="panelHeight:'auto'">
            <option value="0">全部条件</option>
            <option value="1">设备编号</option>
            <option value="2">解除人</option>
        </select>
        <a href="javascript:void(0);" onclick="StatisticsAlarmsLogsModel.search(this);" class="easyui-linkbutton"
           data-options="plain:false,iconCls:'icons-table-table'">查询</a>
    </form>
    <a style="margin-left: 10px;" href="javascript:void(0);" class="easyui-linkbutton"
       data-options="plain:true,iconCls:'icons-table-table_refresh'"
       onclick="StatisticsAlarmsLogsModel.refresh()">刷新</a>
    <!--<a style="margin-left: 10px;" href="javascript:void(0);" class="easyui-linkbutton"-->
    <!--data-options="plain:false,iconCls:'icons-table-table_edit'" onclick="StatisticsAlarmsLogsModel.import()">导出</a>-->
</div>

<script type="text/javascript">

    var StatisticsAlarmsLogsModel = {
        dialog: '#globel-dialog-div',
        datagrid: '#statistics_alarmlogs',

        //操作格式化
        operate: function (val, arr) {
            var btn = [];
            ;
            btn.push('<a href="javascript:void(0);" onclick="StatisticsAlarmsLogsModel.deal(' + val + ')">查看</a>');
            return btn.join(' |  ');
        },

        //刷新
        refresh: function () {
            $(this.datagrid).datagrid('reload');
        },

        //数据查询
        search: function () {
            var keyword = $("#log_alarm_keyword").val();
            var keyword_type = $("#log_alarm_keyword_type").combobox('getValue');
            var alarm_type = $("#alarm_type").combobox('getValue');
            var disposal_platform = $("#disposal_platform").combobox('getValue');
            var end_date = $("#log_alarm_end_date").combobox('getValue');
            var start_date = $("#log_alarm_start_date").combobox('getValue');
            $(this.datagrid).datagrid("load", {
                keyword: keyword,
                keyword_type: keyword_type,
                alarm_type: alarm_type,
                disposal_platform: disposal_platform,
                start_date: start_date,
                end_date: end_date
            });
        },

        //导出
        export: function () {
            $.messager.progress({text: '处理中，请稍候...'});
            $.post('<{:U("admin/System/menuExport")}>', function (res) {
                $.messager.progress('close');

                if (!res.status) {
                    $.app.method.tip('提示信息', res.info, 'error');
                } else {
                    $.app.method.tip('提示信息', res.info, 'info');
                    window.location.href = res.url;
                }
            }, 'json');
        },
    };

</script>